<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Cart
 *
 * @mixin \Eloquent
 * @property int $cart_id 购物车ID
 * @property int $user_id 用户ID
 * @property string $session_id 会话ID
 * @property int $goods_id 商品ID
 * @property int $buy_num
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereBuyNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereCartId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereGoodsId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereSessionId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereUserId($value)
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Cart whereUpdatedAt($value)
 * @property-read \App\Good $good
 */
class Cart extends Model
{
    protected $table='cart';
    protected $primaryKey='cart_id';
    public function good(){
        return $this->belongsTo('App\Good','goods_id');
    }
}
